/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ejb.dao;

import entidades.TipoUsuario;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.Query;

/**
 *
 * @author paulo
 */
@Stateless
public class TipoUsuarioDAO extends GenericoJPADAO<TipoUsuario>implements TipoUsuarioDAOLocal {

    @Override
    public List<TipoUsuario> buscarTodos() {
        Query q = em.createQuery("SELECT object(t) FROM TipoUsuario AS t");
        return q.getResultList();
    }

    @Override
    public int contador() {
        Query q = em.createQuery("SELECT count(t) FROM TipoUsuario AS t");
        return (Integer) q.getSingleResult();
    }
    
}
